| | | 1 | | // Copyright (c) 2020-2023 dotBunny Inc. |
| | | 2 | | // dotBunny licenses this file to you under the BSL-1.0 license. |
| | | 3 | | // See the LICENSE file in the project root for more information. |
| | | 4 | | |
| | | 5 | | using System; |
| | | 6 | | using GDX.Collections; |
| | | 7 | | using GDX.Tables.CellValues; |
| | | 8 | | using UnityEngine; |
| | | 9 | | |
| | | 10 | | namespace GDX.Tables |
| | | 11 | | { |
| | | 12 | | [Serializable] |
| | | 13 | | public class SimpleTable : ScriptableObject, ITable |
| | | 14 | | { |
| | | 15 | | |
| | | 16 | | |
| | | 17 | | |
| | | 18 | | |
| | | 19 | | [Serializable] |
| | | 20 | | internal struct ColumnEntryInternal |
| | | 21 | | { |
| | | 22 | | public ITable.ColumnType ColumnType; |
| | | 23 | | public int columnDenseIndex; |
| | | 24 | | } |
| | | 25 | | |
| | | 26 | | [SerializeField] internal ArrayHolder<string>[] allStringColumns; |
| | | 27 | | [SerializeField] internal ArrayHolder<bool>[] allBoolColumns; |
| | | 28 | | [SerializeField] internal ArrayHolder<char>[] allCharColumns; |
| | | 29 | | [SerializeField] internal ArrayHolder<sbyte>[] allSbyteColumns; |
| | | 30 | | [SerializeField] internal ArrayHolder<byte>[] allByteColumns; |
| | | 31 | | [SerializeField] internal ArrayHolder<short>[] allShortColumns; |
| | | 32 | | [SerializeField] internal ArrayHolder<ushort>[] allUshortColumns; |
| | | 33 | | [SerializeField] internal ArrayHolder<int>[] allIntColumns; |
| | | 34 | | [SerializeField] internal ArrayHolder<uint>[] allUintColumns; |
| | | 35 | | [SerializeField] internal ArrayHolder<long>[] allLongColumns; |
| | | 36 | | [SerializeField] internal ArrayHolder<ulong>[] allUlongColumns; |
| | | 37 | | [SerializeField] internal ArrayHolder<float>[] allFloatColumns; |
| | | 38 | | [SerializeField] internal ArrayHolder<double>[] allDoubleColumns; |
| | | 39 | | [SerializeField] internal ArrayHolder<Vector2>[] allVector2Columns; |
| | | 40 | | [SerializeField] internal ArrayHolder<Vector3>[] allVector3Columns; |
| | | 41 | | [SerializeField] internal ArrayHolder<Vector4>[] allVector4Columns; |
| | | 42 | | [SerializeField] internal ArrayHolder<Vector2Int>[] allVector2IntColumns; |
| | | 43 | | [SerializeField] internal ArrayHolder<Vector3Int>[] allVector3IntColumns; |
| | | 44 | | [SerializeField] internal ArrayHolder<Quaternion>[] allQuaternionColumns; |
| | | 45 | | [SerializeField] internal ArrayHolder<Rect>[] allRectColumns; |
| | | 46 | | [SerializeField] internal ArrayHolder<RectInt>[] allRectIntColumns; |
| | | 47 | | [SerializeField] internal ArrayHolder<Color>[] allColorColumns; |
| | | 48 | | [SerializeField] internal ArrayHolder<LayerMask>[] allLayerMaskColumns; |
| | | 49 | | [SerializeField] internal ArrayHolder<Bounds>[] allBoundsColumns; |
| | | 50 | | [SerializeField] internal ArrayHolder<BoundsInt>[] allBoundsIntColumns; |
| | | 51 | | [SerializeField] internal ArrayHolder<Hash128>[] allHash128Columns; |
| | | 52 | | [SerializeField] internal ArrayHolder<Gradient>[] allGradientColumns; |
| | | 53 | | [SerializeField] internal ArrayHolder<AnimationCurve>[] allAnimationCurveColumns; |
| | | 54 | | [SerializeField] internal ArrayHolder<UnityEngine.Object>[] allObjectRefColumns; |
| | 0 | 55 | | [SerializeField] internal ArrayHolder<string>[] allColumnNames = new ArrayHolder<string>[(int)ITable.ColumnType. |
| | 0 | 56 | | [SerializeField] internal ArrayHolder<int>[] allColumnOrders = new ArrayHolder<int>[(int)ITable.ColumnType.Count |
| | | 57 | | |
| | | 58 | | |
| | | 59 | | [SerializeField] |
| | | 60 | | internal string[] allRowNames; |
| | | 61 | | |
| | | 62 | | [SerializeField] |
| | | 63 | | internal int rowCount; |
| | | 64 | | |
| | | 65 | | [SerializeField] |
| | | 66 | | internal ColumnEntryInternal[] columnIDToDenseIndexMap; |
| | | 67 | | |
| | | 68 | | // TODO move with other block |
| | 0 | 69 | | [SerializeField] ArrayHolder<int>[] columnDenseIndexToIDMap = new ArrayHolder<int>[(int)ITable.ColumnType.Count] |
| | | 70 | | |
| | | 71 | | [SerializeField] |
| | | 72 | | internal int columnEntriesFreeListHead; |
| | | 73 | | |
| | | 74 | | [SerializeField] |
| | | 75 | | internal int combinedColumnCount; |
| | | 76 | | |
| | | 77 | | [SerializeField] |
| | 0 | 78 | | internal ulong dataVersion = 1; |
| | | 79 | | |
| | | 80 | | // BEGIN - View Hacks |
| | | 81 | | public int ColumnCount |
| | | 82 | | { |
| | | 83 | | get |
| | 0 | 84 | | { |
| | 0 | 85 | | return combinedColumnCount; |
| | 0 | 86 | | } |
| | | 87 | | } |
| | | 88 | | |
| | | 89 | | public int RowCount |
| | | 90 | | { |
| | | 91 | | get |
| | 0 | 92 | | { |
| | 0 | 93 | | return rowCount; |
| | 0 | 94 | | } |
| | | 95 | | } |
| | | 96 | | |
| | | 97 | | public ulong GetDataVersion() |
| | 0 | 98 | | { |
| | 0 | 99 | | return dataVersion; |
| | 0 | 100 | | } |
| | | 101 | | |
| | | 102 | | public ITable.ColumnEntry[] GetOrderedColumns() |
| | 0 | 103 | | { |
| | 0 | 104 | | if (combinedColumnCount == 0) return null; |
| | | 105 | | |
| | 0 | 106 | | int columnCount = (int)ITable.ColumnType.Count; |
| | 0 | 107 | | ITable.ColumnEntry[] returnArray = new ITable.ColumnEntry[combinedColumnCount]; |
| | | 108 | | |
| | 0 | 109 | | for (int columnIndex = 0; columnIndex < columnCount; columnIndex++) |
| | 0 | 110 | | { |
| | | 111 | | |
| | 0 | 112 | | int[] columnOrders = allColumnOrders[columnIndex].TArray; |
| | 0 | 113 | | int columnOrdersLength = columnOrders?.Length ?? 0; |
| | | 114 | | |
| | 0 | 115 | | int[] columnIndices = columnDenseIndexToIDMap[columnIndex].TArray; |
| | 0 | 116 | | string[] columnNames = allColumnNames[columnIndex].TArray; |
| | | 117 | | |
| | 0 | 118 | | for (int i = 0; i < columnOrdersLength; i++) |
| | 0 | 119 | | { |
| | 0 | 120 | | returnArray[columnOrders[i]] = new ITable.ColumnEntry |
| | | 121 | | { |
| | | 122 | | Name = columnNames[i], |
| | | 123 | | Id = columnIndices[i], |
| | | 124 | | Type = (ITable.ColumnType)columnIndex |
| | | 125 | | }; |
| | 0 | 126 | | } |
| | 0 | 127 | | } |
| | 0 | 128 | | return returnArray; |
| | 0 | 129 | | } |
| | | 130 | | |
| | | 131 | | |
| | | 132 | | // END - View Hacks |
| | | 133 | | |
| | | 134 | | // TODO: Way to set column name |
| | | 135 | | |
| | | 136 | | |
| | | 137 | | |
| | | 138 | | public void AddRow(string rowName = null, int insertAt = -1) |
| | 0 | 139 | | { |
| | 0 | 140 | | insertAt = insertAt < 0 ? rowCount : insertAt; |
| | | 141 | | |
| | 0 | 142 | | Array.Resize(ref allRowNames, rowCount + 1); |
| | 0 | 143 | | for (int i = rowCount; i > insertAt; i--) |
| | 0 | 144 | | { |
| | 0 | 145 | | allRowNames[i] = allRowNames[i - 1]; |
| | 0 | 146 | | } |
| | | 147 | | |
| | 0 | 148 | | rowName ??= string.Empty; |
| | 0 | 149 | | allRowNames[insertAt] = rowName; |
| | | 150 | | |
| | 0 | 151 | | InsertRowsOfTypeInternal(ref allStringColumns, insertAt, 1); |
| | 0 | 152 | | InsertRowsOfTypeInternal(ref allBoolColumns, insertAt, 1); |
| | 0 | 153 | | InsertRowsOfTypeInternal(ref allCharColumns, insertAt, 1); |
| | 0 | 154 | | InsertRowsOfTypeInternal(ref allSbyteColumns, insertAt, 1); |
| | 0 | 155 | | InsertRowsOfTypeInternal(ref allByteColumns, insertAt, 1); |
| | 0 | 156 | | InsertRowsOfTypeInternal(ref allShortColumns, insertAt, 1); |
| | 0 | 157 | | InsertRowsOfTypeInternal(ref allUshortColumns, insertAt, 1); |
| | 0 | 158 | | InsertRowsOfTypeInternal(ref allIntColumns, insertAt, 1); |
| | 0 | 159 | | InsertRowsOfTypeInternal(ref allUintColumns, insertAt, 1); |
| | 0 | 160 | | InsertRowsOfTypeInternal(ref allLongColumns, insertAt, 1); |
| | 0 | 161 | | InsertRowsOfTypeInternal(ref allUlongColumns, insertAt, 1); |
| | 0 | 162 | | InsertRowsOfTypeInternal(ref allFloatColumns, insertAt, 1); |
| | 0 | 163 | | InsertRowsOfTypeInternal(ref allDoubleColumns, insertAt, 1); |
| | 0 | 164 | | InsertRowsOfTypeInternal(ref allVector2Columns, insertAt, 1); |
| | 0 | 165 | | InsertRowsOfTypeInternal(ref allVector3Columns, insertAt, 1); |
| | 0 | 166 | | InsertRowsOfTypeInternal(ref allVector4Columns, insertAt, 1); |
| | 0 | 167 | | InsertRowsOfTypeInternal(ref allVector2IntColumns, insertAt, 1); |
| | 0 | 168 | | InsertRowsOfTypeInternal(ref allVector3IntColumns, insertAt, 1); |
| | 0 | 169 | | InsertRowsOfTypeInternal(ref allQuaternionColumns, insertAt, 1); |
| | 0 | 170 | | InsertRowsOfTypeInternal(ref allRectColumns, insertAt, 1); |
| | 0 | 171 | | InsertRowsOfTypeInternal(ref allRectIntColumns, insertAt, 1); |
| | 0 | 172 | | InsertRowsOfTypeInternal(ref allColorColumns, insertAt, 1); |
| | 0 | 173 | | InsertRowsOfTypeInternal(ref allLayerMaskColumns, insertAt, 1); |
| | 0 | 174 | | InsertRowsOfTypeInternal(ref allBoundsColumns, insertAt, 1); |
| | 0 | 175 | | InsertRowsOfTypeInternal(ref allBoundsIntColumns, insertAt, 1); |
| | 0 | 176 | | InsertRowsOfTypeInternal(ref allHash128Columns, insertAt, 1); |
| | 0 | 177 | | InsertRowsOfTypeInternal(ref allGradientColumns, insertAt, 1); |
| | 0 | 178 | | InsertRowsOfTypeInternal(ref allAnimationCurveColumns, insertAt, 1); |
| | 0 | 179 | | InsertRowsOfTypeInternal(ref allObjectRefColumns, insertAt, 1); |
| | | 180 | | |
| | 0 | 181 | | ++rowCount; |
| | 0 | 182 | | dataVersion++; |
| | 0 | 183 | | } |
| | | 184 | | |
| | | 185 | | public void AddRows(int numberOfNewRows, string[] rowNames = null, int insertAt = -1) |
| | 0 | 186 | | { |
| | 0 | 187 | | insertAt = insertAt < 0 ? rowCount : insertAt; |
| | | 188 | | |
| | 0 | 189 | | Array.Resize(ref allRowNames, rowCount + 1); |
| | 0 | 190 | | for (int i = rowCount; i > insertAt; i--) |
| | 0 | 191 | | { |
| | 0 | 192 | | allRowNames[i] = allRowNames[i - 1]; |
| | 0 | 193 | | } |
| | | 194 | | |
| | 0 | 195 | | string empty = string.Empty; |
| | 0 | 196 | | int rowNamesLength = rowNames?.Length ?? 0; |
| | 0 | 197 | | for (int i = 0; i < rowNames.Length; i++) |
| | 0 | 198 | | { |
| | 0 | 199 | | string nameAt = rowNames[i]; |
| | 0 | 200 | | allRowNames[insertAt + i] = nameAt ?? empty; |
| | 0 | 201 | | } |
| | | 202 | | |
| | 0 | 203 | | for (int i = rowNamesLength; i < numberOfNewRows; i++) |
| | 0 | 204 | | { |
| | 0 | 205 | | allRowNames[insertAt + i] = empty; |
| | 0 | 206 | | } |
| | | 207 | | |
| | 0 | 208 | | InsertRowsOfTypeInternal(ref allStringColumns, insertAt, numberOfNewRows); |
| | 0 | 209 | | InsertRowsOfTypeInternal(ref allBoolColumns, insertAt, numberOfNewRows); |
| | 0 | 210 | | InsertRowsOfTypeInternal(ref allCharColumns, insertAt, numberOfNewRows); |
| | 0 | 211 | | InsertRowsOfTypeInternal(ref allSbyteColumns, insertAt, numberOfNewRows); |
| | 0 | 212 | | InsertRowsOfTypeInternal(ref allByteColumns, insertAt, numberOfNewRows); |
| | 0 | 213 | | InsertRowsOfTypeInternal(ref allShortColumns, insertAt, numberOfNewRows); |
| | 0 | 214 | | InsertRowsOfTypeInternal(ref allUshortColumns, insertAt, numberOfNewRows); |
| | 0 | 215 | | InsertRowsOfTypeInternal(ref allIntColumns, insertAt, numberOfNewRows); |
| | 0 | 216 | | InsertRowsOfTypeInternal(ref allUintColumns, insertAt, numberOfNewRows); |
| | 0 | 217 | | InsertRowsOfTypeInternal(ref allLongColumns, insertAt, numberOfNewRows); |
| | 0 | 218 | | InsertRowsOfTypeInternal(ref allUlongColumns, insertAt, numberOfNewRows); |
| | 0 | 219 | | InsertRowsOfTypeInternal(ref allFloatColumns, insertAt, numberOfNewRows); |
| | 0 | 220 | | InsertRowsOfTypeInternal(ref allDoubleColumns, insertAt, numberOfNewRows); |
| | 0 | 221 | | InsertRowsOfTypeInternal(ref allVector2Columns, insertAt, numberOfNewRows); |
| | 0 | 222 | | InsertRowsOfTypeInternal(ref allVector3Columns, insertAt, numberOfNewRows); |
| | 0 | 223 | | InsertRowsOfTypeInternal(ref allVector4Columns, insertAt, numberOfNewRows); |
| | 0 | 224 | | InsertRowsOfTypeInternal(ref allVector2IntColumns, insertAt, numberOfNewRows); |
| | 0 | 225 | | InsertRowsOfTypeInternal(ref allVector3IntColumns, insertAt, numberOfNewRows); |
| | 0 | 226 | | InsertRowsOfTypeInternal(ref allQuaternionColumns, insertAt, numberOfNewRows); |
| | 0 | 227 | | InsertRowsOfTypeInternal(ref allRectColumns, insertAt, numberOfNewRows); |
| | 0 | 228 | | InsertRowsOfTypeInternal(ref allRectIntColumns, insertAt, numberOfNewRows); |
| | 0 | 229 | | InsertRowsOfTypeInternal(ref allColorColumns, insertAt, numberOfNewRows); |
| | 0 | 230 | | InsertRowsOfTypeInternal(ref allLayerMaskColumns, insertAt, numberOfNewRows); |
| | 0 | 231 | | InsertRowsOfTypeInternal(ref allBoundsColumns, insertAt, numberOfNewRows); |
| | 0 | 232 | | InsertRowsOfTypeInternal(ref allBoundsIntColumns, insertAt, numberOfNewRows); |
| | 0 | 233 | | InsertRowsOfTypeInternal(ref allHash128Columns, insertAt, numberOfNewRows); |
| | 0 | 234 | | InsertRowsOfTypeInternal(ref allGradientColumns, insertAt, numberOfNewRows); |
| | 0 | 235 | | InsertRowsOfTypeInternal(ref allAnimationCurveColumns, insertAt, numberOfNewRows); |
| | 0 | 236 | | InsertRowsOfTypeInternal(ref allObjectRefColumns, insertAt, numberOfNewRows); |
| | | 237 | | |
| | 0 | 238 | | rowCount += numberOfNewRows; |
| | 0 | 239 | | dataVersion++; |
| | 0 | 240 | | } |
| | | 241 | | |
| | | 242 | | public void RemoveRow(int removeAt) |
| | 0 | 243 | | { |
| | 0 | 244 | | int newRowCount = rowCount - 1; |
| | 0 | 245 | | for (int j = removeAt; j < newRowCount; j++) |
| | 0 | 246 | | { |
| | 0 | 247 | | allRowNames[j] = allRowNames[j + 1]; |
| | 0 | 248 | | } |
| | | 249 | | |
| | 0 | 250 | | Array.Resize(ref allRowNames, newRowCount); |
| | | 251 | | |
| | 0 | 252 | | DeleteRowsOfTypeInternal(ref allStringColumns, removeAt, 1); |
| | 0 | 253 | | DeleteRowsOfTypeInternal(ref allBoolColumns, removeAt, 1); |
| | 0 | 254 | | DeleteRowsOfTypeInternal(ref allCharColumns, removeAt, 1); |
| | 0 | 255 | | DeleteRowsOfTypeInternal(ref allSbyteColumns, removeAt, 1); |
| | 0 | 256 | | DeleteRowsOfTypeInternal(ref allByteColumns, removeAt, 1); |
| | 0 | 257 | | DeleteRowsOfTypeInternal(ref allShortColumns, removeAt, 1); |
| | 0 | 258 | | DeleteRowsOfTypeInternal(ref allUshortColumns, removeAt, 1); |
| | 0 | 259 | | DeleteRowsOfTypeInternal(ref allIntColumns, removeAt, 1); |
| | 0 | 260 | | DeleteRowsOfTypeInternal(ref allUintColumns, removeAt, 1); |
| | 0 | 261 | | DeleteRowsOfTypeInternal(ref allLongColumns, removeAt, 1); |
| | 0 | 262 | | DeleteRowsOfTypeInternal(ref allUlongColumns, removeAt, 1); |
| | 0 | 263 | | DeleteRowsOfTypeInternal(ref allFloatColumns, removeAt, 1); |
| | 0 | 264 | | DeleteRowsOfTypeInternal(ref allDoubleColumns, removeAt, 1); |
| | 0 | 265 | | DeleteRowsOfTypeInternal(ref allVector2Columns, removeAt, 1); |
| | 0 | 266 | | DeleteRowsOfTypeInternal(ref allVector3Columns, removeAt, 1); |
| | 0 | 267 | | DeleteRowsOfTypeInternal(ref allVector4Columns, removeAt, 1); |
| | 0 | 268 | | DeleteRowsOfTypeInternal(ref allVector2IntColumns, removeAt, 1); |
| | 0 | 269 | | DeleteRowsOfTypeInternal(ref allVector3IntColumns, removeAt, 1); |
| | 0 | 270 | | DeleteRowsOfTypeInternal(ref allQuaternionColumns, removeAt, 1); |
| | 0 | 271 | | DeleteRowsOfTypeInternal(ref allRectColumns, removeAt, 1); |
| | 0 | 272 | | DeleteRowsOfTypeInternal(ref allRectIntColumns, removeAt, 1); |
| | 0 | 273 | | DeleteRowsOfTypeInternal(ref allColorColumns, removeAt, 1); |
| | 0 | 274 | | DeleteRowsOfTypeInternal(ref allLayerMaskColumns, removeAt, 1); |
| | 0 | 275 | | DeleteRowsOfTypeInternal(ref allBoundsColumns, removeAt, 1); |
| | 0 | 276 | | DeleteRowsOfTypeInternal(ref allBoundsIntColumns, removeAt, 1); |
| | 0 | 277 | | DeleteRowsOfTypeInternal(ref allHash128Columns, removeAt, 1); |
| | 0 | 278 | | DeleteRowsOfTypeInternal(ref allGradientColumns, removeAt, 1); |
| | 0 | 279 | | DeleteRowsOfTypeInternal(ref allAnimationCurveColumns, removeAt, 1); |
| | 0 | 280 | | DeleteRowsOfTypeInternal(ref allObjectRefColumns, removeAt, 1); |
| | | 281 | | |
| | 0 | 282 | | --rowCount; |
| | 0 | 283 | | dataVersion++; |
| | 0 | 284 | | } |
| | | 285 | | |
| | | 286 | | public void RemoveRows(int removeAt, int numberOfRowsToDelete) |
| | 0 | 287 | | { |
| | 0 | 288 | | int newRowCount = rowCount - numberOfRowsToDelete; |
| | 0 | 289 | | for (int j = removeAt; j < rowCount - numberOfRowsToDelete; j++) |
| | 0 | 290 | | { |
| | 0 | 291 | | allRowNames[j] = allRowNames[j + numberOfRowsToDelete]; |
| | 0 | 292 | | } |
| | | 293 | | |
| | 0 | 294 | | Array.Resize(ref allRowNames, newRowCount); |
| | | 295 | | |
| | 0 | 296 | | DeleteRowsOfTypeInternal(ref allStringColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 297 | | DeleteRowsOfTypeInternal(ref allBoolColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 298 | | DeleteRowsOfTypeInternal(ref allCharColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 299 | | DeleteRowsOfTypeInternal(ref allSbyteColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 300 | | DeleteRowsOfTypeInternal(ref allByteColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 301 | | DeleteRowsOfTypeInternal(ref allShortColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 302 | | DeleteRowsOfTypeInternal(ref allUshortColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 303 | | DeleteRowsOfTypeInternal(ref allIntColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 304 | | DeleteRowsOfTypeInternal(ref allUintColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 305 | | DeleteRowsOfTypeInternal(ref allLongColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 306 | | DeleteRowsOfTypeInternal(ref allUlongColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 307 | | DeleteRowsOfTypeInternal(ref allFloatColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 308 | | DeleteRowsOfTypeInternal(ref allDoubleColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 309 | | DeleteRowsOfTypeInternal(ref allVector2Columns, removeAt, numberOfRowsToDelete); |
| | 0 | 310 | | DeleteRowsOfTypeInternal(ref allVector3Columns, removeAt, numberOfRowsToDelete); |
| | 0 | 311 | | DeleteRowsOfTypeInternal(ref allVector4Columns, removeAt, numberOfRowsToDelete); |
| | 0 | 312 | | DeleteRowsOfTypeInternal(ref allVector2IntColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 313 | | DeleteRowsOfTypeInternal(ref allVector3IntColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 314 | | DeleteRowsOfTypeInternal(ref allQuaternionColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 315 | | DeleteRowsOfTypeInternal(ref allRectColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 316 | | DeleteRowsOfTypeInternal(ref allRectIntColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 317 | | DeleteRowsOfTypeInternal(ref allColorColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 318 | | DeleteRowsOfTypeInternal(ref allLayerMaskColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 319 | | DeleteRowsOfTypeInternal(ref allBoundsColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 320 | | DeleteRowsOfTypeInternal(ref allBoundsIntColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 321 | | DeleteRowsOfTypeInternal(ref allHash128Columns, removeAt, numberOfRowsToDelete); |
| | 0 | 322 | | DeleteRowsOfTypeInternal(ref allGradientColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 323 | | DeleteRowsOfTypeInternal(ref allAnimationCurveColumns, removeAt, numberOfRowsToDelete); |
| | 0 | 324 | | DeleteRowsOfTypeInternal(ref allObjectRefColumns, removeAt, numberOfRowsToDelete); |
| | | 325 | | |
| | 0 | 326 | | rowCount -= numberOfRowsToDelete; |
| | 0 | 327 | | dataVersion++; |
| | 0 | 328 | | } |
| | | 329 | | |
| | | 330 | | // Add Column |
| | | 331 | | |
| | | 332 | | public int AddStringColumn(string columnName, int insertAt = -1) |
| | 0 | 333 | | { |
| | 0 | 334 | | return AddColumnInternal(columnName, ref allStringColumns, ITable.ColumnType.String, insertAt); |
| | 0 | 335 | | } |
| | | 336 | | |
| | | 337 | | public int AddBoolColumn(string columnName, int insertAt = -1) |
| | 0 | 338 | | { |
| | 0 | 339 | | return AddColumnInternal(columnName, ref allBoolColumns, ITable.ColumnType.Bool, insertAt); |
| | 0 | 340 | | } |
| | | 341 | | |
| | | 342 | | public int AddCharColumn(string columnName, int insertAt = -1) |
| | 0 | 343 | | { |
| | 0 | 344 | | return AddColumnInternal(columnName, ref allCharColumns, ITable.ColumnType.Char, insertAt); |
| | 0 | 345 | | } |
| | | 346 | | |
| | | 347 | | public int AddSbyteColumn(string columnName, int insertAt = -1) |
| | 0 | 348 | | { |
| | 0 | 349 | | return AddColumnInternal(columnName, ref allSbyteColumns, ITable.ColumnType.SByte, insertAt); |
| | 0 | 350 | | } |
| | | 351 | | |
| | | 352 | | public int AddByteColumn(string columnName, int insertAt = -1) |
| | 0 | 353 | | { |
| | 0 | 354 | | return AddColumnInternal(columnName, ref allByteColumns, ITable.ColumnType.Byte, insertAt); |
| | 0 | 355 | | } |
| | | 356 | | |
| | | 357 | | public int AddShortColumn(string columnName, int insertAt = -1) |
| | 0 | 358 | | { |
| | 0 | 359 | | return AddColumnInternal(columnName, ref allShortColumns, ITable.ColumnType.Short, insertAt); |
| | 0 | 360 | | } |
| | | 361 | | |
| | | 362 | | public int AddUshortColumn(string columnName, int insertAt = -1) |
| | 0 | 363 | | { |
| | 0 | 364 | | return AddColumnInternal(columnName, ref allUshortColumns, ITable.ColumnType.UShort, insertAt); |
| | 0 | 365 | | } |
| | | 366 | | |
| | | 367 | | public int AddIntColumn(string columnName, int insertAt = -1) |
| | 0 | 368 | | { |
| | 0 | 369 | | return AddColumnInternal(columnName, ref allIntColumns, ITable.ColumnType.Int, insertAt); |
| | 0 | 370 | | } |
| | | 371 | | |
| | | 372 | | public int AddUintColumn(string columnName, int insertAt = -1) |
| | 0 | 373 | | { |
| | 0 | 374 | | return AddColumnInternal(columnName, ref allUintColumns, ITable.ColumnType.UInt, insertAt); |
| | 0 | 375 | | } |
| | | 376 | | |
| | | 377 | | public int AddLongColumn(string columnName, int insertAt = -1) |
| | 0 | 378 | | { |
| | 0 | 379 | | return AddColumnInternal(columnName, ref allLongColumns, ITable.ColumnType.Long, insertAt); |
| | 0 | 380 | | } |
| | | 381 | | |
| | | 382 | | public int AddUlongColumn(string columnName, int insertAt = -1) |
| | 0 | 383 | | { |
| | 0 | 384 | | return AddColumnInternal(columnName, ref allUlongColumns, ITable.ColumnType.ULong, insertAt); |
| | 0 | 385 | | } |
| | | 386 | | |
| | | 387 | | public int AddFloatColumn(string columnName, int insertAt = -1) |
| | 0 | 388 | | { |
| | 0 | 389 | | return AddColumnInternal(columnName, ref allFloatColumns, ITable.ColumnType.Float, insertAt); |
| | 0 | 390 | | } |
| | | 391 | | |
| | | 392 | | public int AddDoubleColumn(string columnName, int insertAt = -1) |
| | 0 | 393 | | { |
| | 0 | 394 | | return AddColumnInternal(columnName, ref allDoubleColumns, ITable.ColumnType.Double, insertAt); |
| | 0 | 395 | | } |
| | | 396 | | |
| | | 397 | | public int AddVector2Column(string columnName, int insertAt = -1) |
| | 0 | 398 | | { |
| | 0 | 399 | | return AddColumnInternal(columnName, ref allVector2Columns, ITable.ColumnType.Vector2, insertAt); |
| | 0 | 400 | | } |
| | | 401 | | |
| | | 402 | | public int AddVector3Column(string columnName, int insertAt = -1) |
| | 0 | 403 | | { |
| | 0 | 404 | | return AddColumnInternal(columnName, ref allVector3Columns, ITable.ColumnType.Vector3, insertAt); |
| | 0 | 405 | | } |
| | | 406 | | |
| | | 407 | | public int AddVector4Column(string columnName, int insertAt = -1) |
| | 0 | 408 | | { |
| | 0 | 409 | | return AddColumnInternal(columnName, ref allVector4Columns, ITable.ColumnType.Vector4, insertAt); |
| | 0 | 410 | | } |
| | | 411 | | |
| | | 412 | | public int AddVector2IntColumn(string columnName, int insertAt = -1) |
| | 0 | 413 | | { |
| | 0 | 414 | | return AddColumnInternal(columnName, ref allVector2IntColumns, ITable.ColumnType.Vector2Int, insertAt); |
| | 0 | 415 | | } |
| | | 416 | | |
| | | 417 | | public int AddVector3IntColumn(string columnName, int insertAt = -1) |
| | 0 | 418 | | { |
| | 0 | 419 | | return AddColumnInternal(columnName, ref allVector3IntColumns, ITable.ColumnType.Vector3Int, insertAt); |
| | 0 | 420 | | } |
| | | 421 | | |
| | | 422 | | public int AddQuaternionColumn(string columnName, int insertAt = -1) |
| | 0 | 423 | | { |
| | 0 | 424 | | return AddColumnInternal(columnName, ref allQuaternionColumns, ITable.ColumnType.Quaternion, insertAt); |
| | 0 | 425 | | } |
| | | 426 | | |
| | | 427 | | public int AddRectColumn(string columnName, int insertAt = -1) |
| | 0 | 428 | | { |
| | 0 | 429 | | return AddColumnInternal(columnName, ref allRectColumns, ITable.ColumnType.Rect, insertAt); |
| | 0 | 430 | | } |
| | | 431 | | |
| | | 432 | | public int AddRectIntColumn(string columnName, int insertAt = -1) |
| | 0 | 433 | | { |
| | 0 | 434 | | return AddColumnInternal(columnName, ref allRectIntColumns, ITable.ColumnType.RectInt, insertAt); |
| | 0 | 435 | | } |
| | | 436 | | |
| | | 437 | | public int AddColorColumn(string columnName, int insertAt = -1) |
| | 0 | 438 | | { |
| | 0 | 439 | | return AddColumnInternal(columnName, ref allColorColumns, ITable.ColumnType.Color, insertAt); |
| | 0 | 440 | | } |
| | | 441 | | |
| | | 442 | | public int AddLayerMaskColumn(string columnName, int insertAt = -1) |
| | 0 | 443 | | { |
| | 0 | 444 | | return AddColumnInternal(columnName, ref allLayerMaskColumns, ITable.ColumnType.LayerMask, insertAt); |
| | 0 | 445 | | } |
| | | 446 | | |
| | | 447 | | public int AddBoundsColumn(string columnName, int insertAt = -1) |
| | 0 | 448 | | { |
| | 0 | 449 | | return AddColumnInternal(columnName, ref allBoundsColumns, ITable.ColumnType.Bounds, insertAt); |
| | 0 | 450 | | } |
| | | 451 | | |
| | | 452 | | public int AddBoundsIntColumn(string columnName, int insertAt = -1) |
| | 0 | 453 | | { |
| | 0 | 454 | | return AddColumnInternal(columnName, ref allBoundsIntColumns, ITable.ColumnType.BoundsInt, insertAt); |
| | 0 | 455 | | } |
| | | 456 | | |
| | | 457 | | public int AddHash128Column(string columnName, int insertAt = -1) |
| | 0 | 458 | | { |
| | 0 | 459 | | return AddColumnInternal(columnName, ref allHash128Columns, ITable.ColumnType.Hash128, insertAt); |
| | 0 | 460 | | } |
| | | 461 | | |
| | | 462 | | public int AddGradientColumn(string columnName, int insertAt = -1) |
| | 0 | 463 | | { |
| | 0 | 464 | | return AddColumnInternal(columnName, ref allGradientColumns, ITable.ColumnType.Gradient, insertAt); |
| | 0 | 465 | | } |
| | | 466 | | |
| | | 467 | | public int AddAnimationCurveColumn(string columnName, int insertAt = -1) |
| | 0 | 468 | | { |
| | 0 | 469 | | return AddColumnInternal(columnName, ref allAnimationCurveColumns, ITable.ColumnType.AnimationCurve, insertA |
| | 0 | 470 | | } |
| | | 471 | | |
| | | 472 | | public int AddObjectColumn(string columnName, int insertAt = -1) |
| | 0 | 473 | | { |
| | 0 | 474 | | return AddColumnInternal(columnName, ref allObjectRefColumns, ITable.ColumnType.Object, insertAt); |
| | 0 | 475 | | } |
| | | 476 | | |
| | | 477 | | // Remove Column |
| | | 478 | | |
| | | 479 | | public void RemoveStringColumn(int removeAt) |
| | 0 | 480 | | { |
| | 0 | 481 | | RemoveColumnInternal(ref allStringColumns, ITable.ColumnType.String, removeAt); |
| | 0 | 482 | | } |
| | | 483 | | |
| | | 484 | | public void RemoveBoolColumn(int removeAt) |
| | 0 | 485 | | { |
| | 0 | 486 | | RemoveColumnInternal(ref allBoolColumns, ITable.ColumnType.Bool, removeAt); |
| | 0 | 487 | | } |
| | | 488 | | |
| | | 489 | | public void RemoveCharColumn(int removeAt) |
| | 0 | 490 | | { |
| | 0 | 491 | | RemoveColumnInternal(ref allCharColumns, ITable.ColumnType.Char, removeAt); |
| | 0 | 492 | | } |
| | | 493 | | |
| | | 494 | | public void RemoveSbyteColumn(int removeAt) |
| | 0 | 495 | | { |
| | 0 | 496 | | RemoveColumnInternal(ref allSbyteColumns, ITable.ColumnType.SByte, removeAt); |
| | 0 | 497 | | } |
| | | 498 | | |
| | | 499 | | public void RemoveByteColumn(int removeAt) |
| | 0 | 500 | | { |
| | 0 | 501 | | RemoveColumnInternal(ref allByteColumns, ITable.ColumnType.Byte, removeAt); |
| | 0 | 502 | | } |
| | | 503 | | |
| | | 504 | | public void RemoveShortColumn(int removeAt) |
| | 0 | 505 | | { |
| | 0 | 506 | | RemoveColumnInternal(ref allShortColumns, ITable.ColumnType.Short, removeAt); |
| | 0 | 507 | | } |
| | | 508 | | |
| | | 509 | | public void RemoveUshortColumn(int removeAt) |
| | 0 | 510 | | { |
| | 0 | 511 | | RemoveColumnInternal(ref allUshortColumns, ITable.ColumnType.UShort, removeAt); |
| | 0 | 512 | | } |
| | | 513 | | |
| | | 514 | | public void RemoveIntColumn(int removeAt) |
| | 0 | 515 | | { |
| | 0 | 516 | | RemoveColumnInternal(ref allIntColumns, ITable.ColumnType.Int, removeAt); |
| | 0 | 517 | | } |
| | | 518 | | |
| | | 519 | | public void RemoveUintColumn(int removeAt) |
| | 0 | 520 | | { |
| | 0 | 521 | | RemoveColumnInternal(ref allUintColumns, ITable.ColumnType.UInt, removeAt); |
| | 0 | 522 | | } |
| | | 523 | | |
| | | 524 | | public void RemoveLongColumn(int removeAt) |
| | 0 | 525 | | { |
| | 0 | 526 | | RemoveColumnInternal(ref allLongColumns, ITable.ColumnType.Long, removeAt); |
| | 0 | 527 | | } |
| | | 528 | | |
| | | 529 | | public void RemoveUlongColumn(int removeAt) |
| | 0 | 530 | | { |
| | 0 | 531 | | RemoveColumnInternal(ref allUlongColumns, ITable.ColumnType.ULong, removeAt); |
| | 0 | 532 | | } |
| | | 533 | | |
| | | 534 | | public void RemoveFloatColumn(int removeAt) |
| | 0 | 535 | | { |
| | 0 | 536 | | RemoveColumnInternal(ref allFloatColumns, ITable.ColumnType.Float, removeAt); |
| | 0 | 537 | | } |
| | | 538 | | |
| | | 539 | | public void RemoveDoubleColumn(int removeAt) |
| | 0 | 540 | | { |
| | 0 | 541 | | RemoveColumnInternal(ref allDoubleColumns, ITable.ColumnType.Double, removeAt); |
| | 0 | 542 | | } |
| | | 543 | | |
| | | 544 | | public void RemoveVector2Column(int removeAt) |
| | 0 | 545 | | { |
| | 0 | 546 | | RemoveColumnInternal(ref allVector2Columns, ITable.ColumnType.Vector2, removeAt); |
| | 0 | 547 | | } |
| | | 548 | | |
| | | 549 | | public void RemoveVector3Column(int removeAt) |
| | 0 | 550 | | { |
| | 0 | 551 | | RemoveColumnInternal(ref allVector3Columns, ITable.ColumnType.Vector3, removeAt); |
| | 0 | 552 | | } |
| | | 553 | | |
| | | 554 | | public void RemoveVector4Column(int removeAt) |
| | 0 | 555 | | { |
| | 0 | 556 | | RemoveColumnInternal(ref allVector4Columns, ITable.ColumnType.Vector4, removeAt); |
| | 0 | 557 | | } |
| | | 558 | | |
| | | 559 | | public void RemoveVector2IntColumn(int removeAt) |
| | 0 | 560 | | { |
| | 0 | 561 | | RemoveColumnInternal(ref allVector2IntColumns, ITable.ColumnType.Vector2Int, removeAt); |
| | 0 | 562 | | } |
| | | 563 | | |
| | | 564 | | public void RemoveVector3IntColumn(int removeAt) |
| | 0 | 565 | | { |
| | 0 | 566 | | RemoveColumnInternal(ref allVector3IntColumns, ITable.ColumnType.Vector3Int, removeAt); |
| | 0 | 567 | | } |
| | | 568 | | |
| | | 569 | | public void RemoveQuaternionColumn(int removeAt) |
| | 0 | 570 | | { |
| | 0 | 571 | | RemoveColumnInternal(ref allQuaternionColumns, ITable.ColumnType.Quaternion, removeAt); |
| | 0 | 572 | | } |
| | | 573 | | |
| | | 574 | | public void RemoveRectColumn(int removeAt) |
| | 0 | 575 | | { |
| | 0 | 576 | | RemoveColumnInternal(ref allRectColumns, ITable.ColumnType.Rect, removeAt); |
| | 0 | 577 | | } |
| | | 578 | | |
| | | 579 | | public void RemoveRectIntColumn(int removeAt) |
| | 0 | 580 | | { |
| | 0 | 581 | | RemoveColumnInternal(ref allRectIntColumns, ITable.ColumnType.RectInt, removeAt); |
| | 0 | 582 | | } |
| | | 583 | | |
| | | 584 | | public void RemoveColorColumn(int removeAt) |
| | 0 | 585 | | { |
| | 0 | 586 | | RemoveColumnInternal(ref allColorColumns, ITable.ColumnType.Color, removeAt); |
| | 0 | 587 | | } |
| | | 588 | | |
| | | 589 | | public void RemoveLayerMaskColumn(int removeAt) |
| | 0 | 590 | | { |
| | 0 | 591 | | RemoveColumnInternal(ref allLayerMaskColumns, ITable.ColumnType.LayerMask, removeAt); |
| | 0 | 592 | | } |
| | | 593 | | |
| | | 594 | | public void RemoveBoundsColumn(int removeAt) |
| | 0 | 595 | | { |
| | 0 | 596 | | RemoveColumnInternal(ref allBoundsColumns, ITable.ColumnType.Bounds, removeAt); |
| | 0 | 597 | | } |
| | | 598 | | |
| | | 599 | | public void RemoveBoundsIntColumn(int removeAt) |
| | 0 | 600 | | { |
| | 0 | 601 | | RemoveColumnInternal(ref allBoundsIntColumns, ITable.ColumnType.BoundsInt, removeAt); |
| | 0 | 602 | | } |
| | | 603 | | |
| | | 604 | | public void RemoveHash128Column(int removeAt) |
| | 0 | 605 | | { |
| | 0 | 606 | | RemoveColumnInternal(ref allHash128Columns, ITable.ColumnType.Hash128, removeAt); |
| | 0 | 607 | | } |
| | | 608 | | |
| | | 609 | | public void RemoveGradientColumn(int removeAt) |
| | 0 | 610 | | { |
| | 0 | 611 | | RemoveColumnInternal(ref allGradientColumns, ITable.ColumnType.Gradient, removeAt); |
| | 0 | 612 | | } |
| | | 613 | | |
| | | 614 | | public void RemoveAnimationCurveColumn(int removeAt) |
| | 0 | 615 | | { |
| | 0 | 616 | | RemoveColumnInternal(ref allAnimationCurveColumns, ITable.ColumnType.AnimationCurve, removeAt); |
| | 0 | 617 | | } |
| | | 618 | | |
| | | 619 | | public void RemoveObjectColumn(int removeAt) |
| | 0 | 620 | | { |
| | 0 | 621 | | RemoveColumnInternal(ref allObjectRefColumns, ITable.ColumnType.Object, removeAt); |
| | 0 | 622 | | } |
| | | 623 | | |
| | | 624 | | // Set |
| | | 625 | | |
| | | 626 | | public ulong SetString(int row, int columnID, string value) |
| | 0 | 627 | | { |
| | 0 | 628 | | return SetCell(row, columnID, ref allStringColumns, value); |
| | 0 | 629 | | } |
| | | 630 | | |
| | | 631 | | public ulong SetBool(int row, int columnID, bool value) |
| | 0 | 632 | | { |
| | 0 | 633 | | return SetCell(row, columnID, ref allBoolColumns, value); |
| | 0 | 634 | | } |
| | | 635 | | |
| | | 636 | | public ulong SetChar(int row, int columnID, char value) |
| | 0 | 637 | | { |
| | 0 | 638 | | return SetCell(row, columnID, ref allCharColumns, value); |
| | 0 | 639 | | } |
| | | 640 | | |
| | | 641 | | public ulong SetSByte(int row, int columnID, sbyte value) |
| | 0 | 642 | | { |
| | 0 | 643 | | return SetCell(row, columnID, ref allSbyteColumns, value); |
| | 0 | 644 | | } |
| | | 645 | | |
| | | 646 | | public ulong SetByte(int row, int columnID, byte value) |
| | 0 | 647 | | { |
| | 0 | 648 | | return SetCell(row, columnID, ref allByteColumns, value); |
| | 0 | 649 | | } |
| | | 650 | | |
| | | 651 | | public ulong SetShort(int row, int columnID, short value) |
| | 0 | 652 | | { |
| | 0 | 653 | | return SetCell(row, columnID, ref allShortColumns, value); |
| | 0 | 654 | | } |
| | | 655 | | |
| | | 656 | | public ulong SetUShort(int row, int columnID, ushort value) |
| | 0 | 657 | | { |
| | 0 | 658 | | return SetCell(row, columnID, ref allUshortColumns, value); |
| | 0 | 659 | | } |
| | | 660 | | |
| | | 661 | | public ulong SetInt(int row, int columnID, int value) |
| | 0 | 662 | | { |
| | 0 | 663 | | return SetCell(row, columnID, ref allIntColumns, value); |
| | 0 | 664 | | } |
| | | 665 | | |
| | | 666 | | public ulong SetUInt(int row, int columnID, uint value) |
| | 0 | 667 | | { |
| | 0 | 668 | | return SetCell(row, columnID, ref allUintColumns, value); |
| | 0 | 669 | | } |
| | | 670 | | |
| | | 671 | | public ulong SetLong(int row, int columnID, long value) |
| | 0 | 672 | | { |
| | 0 | 673 | | return SetCell(row, columnID, ref allLongColumns, value); |
| | 0 | 674 | | } |
| | | 675 | | |
| | | 676 | | public ulong SetULong(int row, int columnID, ulong value) |
| | 0 | 677 | | { |
| | 0 | 678 | | return SetCell(row, columnID, ref allUlongColumns, value); |
| | 0 | 679 | | } |
| | | 680 | | |
| | | 681 | | public ulong SetFloat(int row, int columnID, float value) |
| | 0 | 682 | | { |
| | 0 | 683 | | return SetCell(row, columnID, ref allFloatColumns, value); |
| | 0 | 684 | | } |
| | | 685 | | |
| | | 686 | | public ulong SetDouble(int row, int columnID, double value) |
| | 0 | 687 | | { |
| | 0 | 688 | | return SetCell(row, columnID, ref allDoubleColumns, value); |
| | 0 | 689 | | } |
| | | 690 | | |
| | | 691 | | public ulong SetVector2(int row, int columnID, Vector2 value) |
| | 0 | 692 | | { |
| | 0 | 693 | | return SetCell(row, columnID, ref allVector2Columns, value); |
| | 0 | 694 | | } |
| | | 695 | | |
| | | 696 | | public ulong SetVector3(int row, int columnID, Vector3 value) |
| | 0 | 697 | | { |
| | 0 | 698 | | return SetCell(row, columnID, ref allVector3Columns, value); |
| | 0 | 699 | | } |
| | | 700 | | |
| | | 701 | | public ulong SetVector4(int row, int columnID, Vector4 value) |
| | 0 | 702 | | { |
| | 0 | 703 | | return SetCell(row, columnID, ref allVector4Columns, value); |
| | 0 | 704 | | } |
| | | 705 | | |
| | | 706 | | public ulong SetVector2Int(int row, int columnID, Vector2Int value) |
| | 0 | 707 | | { |
| | 0 | 708 | | return SetCell(row, columnID, ref allVector2IntColumns, value); |
| | 0 | 709 | | } |
| | | 710 | | |
| | | 711 | | public ulong SetVector3Int(int row, int columnID, Vector3Int value) |
| | 0 | 712 | | { |
| | 0 | 713 | | return SetCell(row, columnID, ref allVector3IntColumns, value); |
| | 0 | 714 | | } |
| | | 715 | | |
| | | 716 | | public ulong SetQuaternion(int row, int columnID, Quaternion value) |
| | 0 | 717 | | { |
| | 0 | 718 | | return SetCell(row, columnID, ref allQuaternionColumns, value); |
| | 0 | 719 | | } |
| | | 720 | | |
| | | 721 | | public ulong SetRect(int row, int columnID, Rect value) |
| | 0 | 722 | | { |
| | 0 | 723 | | return SetCell(row, columnID, ref allRectColumns, value); |
| | 0 | 724 | | } |
| | | 725 | | |
| | | 726 | | public ulong SetRectInt(int row, int columnID, RectInt value) |
| | 0 | 727 | | { |
| | 0 | 728 | | return SetCell(row, columnID, ref allRectIntColumns, value); |
| | 0 | 729 | | } |
| | | 730 | | |
| | | 731 | | public ulong SetColor(int row, int columnID, Color value) |
| | 0 | 732 | | { |
| | 0 | 733 | | return SetCell(row, columnID, ref allColorColumns, value); |
| | 0 | 734 | | } |
| | | 735 | | |
| | | 736 | | public ulong SetLayerMask(int row, int columnID, LayerMask value) |
| | 0 | 737 | | { |
| | 0 | 738 | | return SetCell(row, columnID, ref allLayerMaskColumns, value); |
| | 0 | 739 | | } |
| | | 740 | | |
| | | 741 | | public ulong SetBounds(int row, int columnID, Bounds value) |
| | 0 | 742 | | { |
| | 0 | 743 | | return SetCell(row, columnID, ref allBoundsColumns, value); |
| | 0 | 744 | | } |
| | | 745 | | |
| | | 746 | | public ulong SetBoundsInt(int row, int columnID, BoundsInt value) |
| | 0 | 747 | | { |
| | 0 | 748 | | return SetCell(row, columnID, ref allBoundsIntColumns, value); |
| | 0 | 749 | | } |
| | | 750 | | |
| | | 751 | | public ulong SetHash128(int row, int columnID, Hash128 value) |
| | 0 | 752 | | { |
| | 0 | 753 | | return SetCell(row, columnID, ref allHash128Columns, value); |
| | 0 | 754 | | } |
| | | 755 | | |
| | | 756 | | public ulong SetGradient(int row, int columnID, Gradient value) |
| | 0 | 757 | | { |
| | 0 | 758 | | return SetCell(row, columnID, ref allGradientColumns, value); |
| | 0 | 759 | | } |
| | | 760 | | |
| | | 761 | | public ulong SetAnimationCurve(int row, int columnID, AnimationCurve value) |
| | 0 | 762 | | { |
| | 0 | 763 | | return SetCell(row, columnID, ref allAnimationCurveColumns, value); |
| | 0 | 764 | | } |
| | | 765 | | |
| | | 766 | | public ulong SetObject(int row, int columnID, UnityEngine.Object value) |
| | 0 | 767 | | { |
| | 0 | 768 | | return SetCell(row, columnID, ref allObjectRefColumns, value); |
| | 0 | 769 | | } |
| | | 770 | | |
| | | 771 | | // Get |
| | | 772 | | public string GetString(int row, int columnID) |
| | 0 | 773 | | { |
| | 0 | 774 | | return GetCell(row, columnID, ref allStringColumns); |
| | 0 | 775 | | } |
| | | 776 | | |
| | | 777 | | public bool GetBool(int row, int columnID) |
| | 0 | 778 | | { |
| | 0 | 779 | | return GetCell(row, columnID, ref allBoolColumns); |
| | 0 | 780 | | } |
| | | 781 | | |
| | | 782 | | public char GetChar(int row, int columnID) |
| | 0 | 783 | | { |
| | 0 | 784 | | return GetCell(row, columnID, ref allCharColumns); |
| | 0 | 785 | | } |
| | | 786 | | |
| | | 787 | | public sbyte GetSByte(int row, int columnID) |
| | 0 | 788 | | { |
| | 0 | 789 | | return GetCell(row, columnID, ref allSbyteColumns); |
| | 0 | 790 | | } |
| | | 791 | | |
| | | 792 | | public byte GetByte(int row, int columnID) |
| | 0 | 793 | | { |
| | 0 | 794 | | return GetCell(row, columnID, ref allByteColumns); |
| | 0 | 795 | | } |
| | | 796 | | |
| | | 797 | | public short GetShort(int row, int columnID) |
| | 0 | 798 | | { |
| | 0 | 799 | | return GetCell(row, columnID, ref allShortColumns); |
| | 0 | 800 | | } |
| | | 801 | | |
| | | 802 | | public ushort GetUShort(int row, int columnID) |
| | 0 | 803 | | { |
| | 0 | 804 | | return GetCell(row, columnID, ref allUshortColumns); |
| | 0 | 805 | | } |
| | | 806 | | |
| | | 807 | | public int GetInt(int row, int columnID) |
| | 0 | 808 | | { |
| | 0 | 809 | | return GetCell(row, columnID, ref allIntColumns); |
| | 0 | 810 | | } |
| | | 811 | | |
| | | 812 | | public uint GetUInt(int row, int columnID) |
| | 0 | 813 | | { |
| | 0 | 814 | | return GetCell(row, columnID, ref allUintColumns); |
| | 0 | 815 | | } |
| | | 816 | | |
| | | 817 | | public long GetLong(int row, int columnID) |
| | 0 | 818 | | { |
| | 0 | 819 | | return GetCell(row, columnID, ref allLongColumns); |
| | 0 | 820 | | } |
| | | 821 | | |
| | | 822 | | public ulong GetULong(int row, int columnID) |
| | 0 | 823 | | { |
| | 0 | 824 | | return GetCell(row, columnID, ref allUlongColumns); |
| | 0 | 825 | | } |
| | | 826 | | |
| | | 827 | | public float GetFloat(int row, int columnID) |
| | 0 | 828 | | { |
| | 0 | 829 | | return GetCell(row, columnID, ref allFloatColumns); |
| | 0 | 830 | | } |
| | | 831 | | |
| | | 832 | | public double GetDouble(int row, int columnID) |
| | 0 | 833 | | { |
| | 0 | 834 | | return GetCell(row, columnID, ref allDoubleColumns); |
| | 0 | 835 | | } |
| | | 836 | | |
| | | 837 | | public Vector2 GetVector2(int row, int columnID) |
| | 0 | 838 | | { |
| | 0 | 839 | | return GetCell(row, columnID, ref allVector2Columns); |
| | 0 | 840 | | } |
| | | 841 | | |
| | | 842 | | public Vector3 GetVector3(int row, int columnID) |
| | 0 | 843 | | { |
| | 0 | 844 | | return GetCell(row, columnID, ref allVector3Columns); |
| | 0 | 845 | | } |
| | | 846 | | |
| | | 847 | | public Vector4 GetVector4(int row, int columnID) |
| | 0 | 848 | | { |
| | 0 | 849 | | return GetCell(row, columnID, ref allVector4Columns); |
| | 0 | 850 | | } |
| | | 851 | | |
| | | 852 | | public Vector2Int GetVector2Int(int row, int columnID) |
| | 0 | 853 | | { |
| | 0 | 854 | | return GetCell(row, columnID, ref allVector2IntColumns); |
| | 0 | 855 | | } |
| | | 856 | | |
| | | 857 | | public Vector3Int GetVector3Int(int row, int columnID) |
| | 0 | 858 | | { |
| | 0 | 859 | | return GetCell(row, columnID, ref allVector3IntColumns); |
| | 0 | 860 | | } |
| | | 861 | | |
| | | 862 | | public Quaternion GetQuaternion(int row, int columnID) |
| | 0 | 863 | | { |
| | 0 | 864 | | return GetCell(row, columnID, ref allQuaternionColumns); |
| | 0 | 865 | | } |
| | | 866 | | |
| | | 867 | | public Rect GetRect(int row, int columnID) |
| | 0 | 868 | | { |
| | 0 | 869 | | return GetCell(row, columnID, ref allRectColumns); |
| | 0 | 870 | | } |
| | | 871 | | |
| | | 872 | | public RectInt GetRectInt(int row, int columnID) |
| | 0 | 873 | | { |
| | 0 | 874 | | return GetCell(row, columnID, ref allRectIntColumns); |
| | 0 | 875 | | } |
| | | 876 | | |
| | | 877 | | public Color GetColor(int row, int columnID) |
| | 0 | 878 | | { |
| | 0 | 879 | | return GetCell(row, columnID, ref allColorColumns); |
| | 0 | 880 | | } |
| | | 881 | | |
| | | 882 | | public LayerMask GetLayerMask(int row, int columnID) |
| | 0 | 883 | | { |
| | 0 | 884 | | return GetCell(row, columnID, ref allLayerMaskColumns); |
| | 0 | 885 | | } |
| | | 886 | | |
| | | 887 | | public Bounds GetBounds(int row, int columnID) |
| | 0 | 888 | | { |
| | 0 | 889 | | return GetCell(row, columnID, ref allBoundsColumns); |
| | 0 | 890 | | } |
| | | 891 | | |
| | | 892 | | public BoundsInt GetBoundsInt(int row, int columnID) |
| | 0 | 893 | | { |
| | 0 | 894 | | return GetCell(row, columnID, ref allBoundsIntColumns); |
| | 0 | 895 | | } |
| | | 896 | | |
| | | 897 | | public Hash128 GetHash128(int row, int columnID) |
| | 0 | 898 | | { |
| | 0 | 899 | | return GetCell(row, columnID, ref allHash128Columns); |
| | 0 | 900 | | } |
| | | 901 | | |
| | | 902 | | public Gradient GetGradient(int row, int columnID) |
| | 0 | 903 | | { |
| | 0 | 904 | | return GetCell(row, columnID, ref allGradientColumns); |
| | 0 | 905 | | } |
| | | 906 | | |
| | | 907 | | public AnimationCurve GetAnimationCurve(int row, int columnID) |
| | 0 | 908 | | { |
| | 0 | 909 | | return GetCell(row, columnID, ref allAnimationCurveColumns); |
| | 0 | 910 | | } |
| | | 911 | | |
| | | 912 | | public UnityEngine.Object GetObject(int row, int columnID) |
| | 0 | 913 | | { |
| | 0 | 914 | | return GetCell(row, columnID, ref allObjectRefColumns); |
| | 0 | 915 | | } |
| | | 916 | | |
| | | 917 | | // Get ref |
| | | 918 | | |
| | | 919 | | public ref string GetStringRef(int row, int columnID) |
| | 0 | 920 | | { |
| | 0 | 921 | | return ref GetCellRef(row, columnID, ref allStringColumns); |
| | 0 | 922 | | } |
| | | 923 | | |
| | | 924 | | public ref bool GetBoolRef(int row, int columnID) |
| | 0 | 925 | | { |
| | 0 | 926 | | return ref GetCellRef(row, columnID, ref allBoolColumns); |
| | 0 | 927 | | } |
| | | 928 | | |
| | | 929 | | public ref char GetCharRef(int row, int columnID) |
| | 0 | 930 | | { |
| | 0 | 931 | | return ref GetCellRef(row, columnID, ref allCharColumns); |
| | 0 | 932 | | } |
| | | 933 | | |
| | | 934 | | public ref sbyte GetSbyteRef(int row, int columnID) |
| | 0 | 935 | | { |
| | 0 | 936 | | return ref GetCellRef(row, columnID, ref allSbyteColumns); |
| | 0 | 937 | | } |
| | | 938 | | |
| | | 939 | | public ref byte GetByteRef(int row, int columnID) |
| | 0 | 940 | | { |
| | 0 | 941 | | return ref GetCellRef(row, columnID, ref allByteColumns); |
| | 0 | 942 | | } |
| | | 943 | | |
| | | 944 | | public ref short GetShortRef(int row, int columnID) |
| | 0 | 945 | | { |
| | 0 | 946 | | return ref GetCellRef(row, columnID, ref allShortColumns); |
| | 0 | 947 | | } |
| | | 948 | | |
| | | 949 | | public ref ushort GetUshortRef(int row, int columnID) |
| | 0 | 950 | | { |
| | 0 | 951 | | return ref GetCellRef(row, columnID, ref allUshortColumns); |
| | 0 | 952 | | } |
| | | 953 | | |
| | | 954 | | public ref int GetIntRef(int row, int columnID) |
| | 0 | 955 | | { |
| | 0 | 956 | | return ref GetCellRef(row, columnID, ref allIntColumns); |
| | 0 | 957 | | } |
| | | 958 | | |
| | | 959 | | public ref uint GetUintRef(int row, int columnID) |
| | 0 | 960 | | { |
| | 0 | 961 | | return ref GetCellRef(row, columnID, ref allUintColumns); |
| | 0 | 962 | | } |
| | | 963 | | |
| | | 964 | | public ref long GetLongRef(int row, int columnID) |
| | 0 | 965 | | { |
| | 0 | 966 | | return ref GetCellRef(row, columnID, ref allLongColumns); |
| | 0 | 967 | | } |
| | | 968 | | |
| | | 969 | | public ref ulong GetUlongRef(int row, int columnID) |
| | 0 | 970 | | { |
| | 0 | 971 | | return ref GetCellRef(row, columnID, ref allUlongColumns); |
| | 0 | 972 | | } |
| | | 973 | | |
| | | 974 | | public ref float GetFloatRef(int row, int columnID) |
| | 0 | 975 | | { |
| | 0 | 976 | | return ref GetCellRef(row, columnID, ref allFloatColumns); |
| | 0 | 977 | | } |
| | | 978 | | |
| | | 979 | | public ref double GetDoubleRef(int row, int columnID) |
| | 0 | 980 | | { |
| | 0 | 981 | | return ref GetCellRef(row, columnID, ref allDoubleColumns); |
| | 0 | 982 | | } |
| | | 983 | | |
| | | 984 | | public ref Vector2 GetVector2Ref(int row, int columnID) |
| | 0 | 985 | | { |
| | 0 | 986 | | return ref GetCellRef(row, columnID, ref allVector2Columns); |
| | 0 | 987 | | } |
| | | 988 | | |
| | | 989 | | public ref Vector3 GetVector3Ref(int row, int columnID) |
| | 0 | 990 | | { |
| | 0 | 991 | | return ref GetCellRef(row, columnID, ref allVector3Columns); |
| | 0 | 992 | | } |
| | | 993 | | |
| | | 994 | | public ref Vector4 GetVector4Ref(int row, int columnID) |
| | 0 | 995 | | { |
| | 0 | 996 | | return ref GetCellRef(row, columnID, ref allVector4Columns); |
| | 0 | 997 | | } |
| | | 998 | | |
| | | 999 | | public ref Vector2Int GetVector2IntRef(int row, int columnID) |
| | 0 | 1000 | | { |
| | 0 | 1001 | | return ref GetCellRef(row, columnID, ref allVector2IntColumns); |
| | 0 | 1002 | | } |
| | | 1003 | | |
| | | 1004 | | public ref Vector3Int GetVector3IntRef(int row, int columnID) |
| | 0 | 1005 | | { |
| | 0 | 1006 | | return ref GetCellRef(row, columnID, ref allVector3IntColumns); |
| | 0 | 1007 | | } |
| | | 1008 | | |
| | | 1009 | | public ref Quaternion GetQuaternionRef(int row, int columnID) |
| | 0 | 1010 | | { |
| | 0 | 1011 | | return ref GetCellRef(row, columnID, ref allQuaternionColumns); |
| | 0 | 1012 | | } |
| | | 1013 | | |
| | | 1014 | | public ref Rect GetRectRef(int row, int columnID) |
| | 0 | 1015 | | { |
| | 0 | 1016 | | return ref GetCellRef(row, columnID, ref allRectColumns); |
| | 0 | 1017 | | } |
| | | 1018 | | |
| | | 1019 | | public ref RectInt GetRectIntRef(int row, int columnID) |
| | 0 | 1020 | | { |
| | 0 | 1021 | | return ref GetCellRef(row, columnID, ref allRectIntColumns); |
| | 0 | 1022 | | } |
| | | 1023 | | |
| | | 1024 | | public ref Color GetColorRef(int row, int columnID) |
| | 0 | 1025 | | { |
| | 0 | 1026 | | return ref GetCellRef(row, columnID, ref allColorColumns); |
| | 0 | 1027 | | } |
| | | 1028 | | |
| | | 1029 | | public ref LayerMask GetLayerMaskRef(int row, int columnID) |
| | 0 | 1030 | | { |
| | 0 | 1031 | | return ref GetCellRef(row, columnID, ref allLayerMaskColumns); |
| | 0 | 1032 | | } |
| | | 1033 | | |
| | | 1034 | | public ref Bounds GetBoundsRef(int row, int columnID) |
| | 0 | 1035 | | { |
| | 0 | 1036 | | return ref GetCellRef(row, columnID, ref allBoundsColumns); |
| | 0 | 1037 | | } |
| | | 1038 | | |
| | | 1039 | | public ref BoundsInt GetBoundsIntRef(int row, int columnID) |
| | 0 | 1040 | | { |
| | 0 | 1041 | | return ref GetCellRef(row, columnID, ref allBoundsIntColumns); |
| | 0 | 1042 | | } |
| | | 1043 | | |
| | | 1044 | | public ref Hash128 GetHash128Ref(int row, int columnID) |
| | 0 | 1045 | | { |
| | 0 | 1046 | | return ref GetCellRef(row, columnID, ref allHash128Columns); |
| | 0 | 1047 | | } |
| | | 1048 | | |
| | | 1049 | | public ref Gradient GetGradientRef(int row, int columnID) |
| | 0 | 1050 | | { |
| | 0 | 1051 | | return ref GetCellRef(row, columnID, ref allGradientColumns); |
| | 0 | 1052 | | } |
| | | 1053 | | |
| | | 1054 | | public ref AnimationCurve GetAnimationCurveRef(int row, int columnID) |
| | 0 | 1055 | | { |
| | 0 | 1056 | | return ref GetCellRef(row, columnID, ref allAnimationCurveColumns); |
| | 0 | 1057 | | } |
| | | 1058 | | |
| | | 1059 | | public ref UnityEngine.Object GetObjectRef(int row, int columnID) |
| | 0 | 1060 | | { |
| | 0 | 1061 | | return ref GetCellRef(row, columnID, ref allObjectRefColumns); |
| | 0 | 1062 | | } |
| | | 1063 | | |
| | | 1064 | | // Get Column |
| | | 1065 | | |
| | | 1066 | | public string[] GetStringColumn(int columnID) |
| | 0 | 1067 | | { |
| | 0 | 1068 | | return GetColumn(columnID, ref allStringColumns); |
| | 0 | 1069 | | } |
| | | 1070 | | |
| | | 1071 | | public bool[] GetBoolColumn(int columnID) |
| | 0 | 1072 | | { |
| | 0 | 1073 | | return GetColumn(columnID, ref allBoolColumns); |
| | 0 | 1074 | | } |
| | | 1075 | | |
| | | 1076 | | public char[] GetCharColumn(int columnID) |
| | 0 | 1077 | | { |
| | 0 | 1078 | | return GetColumn(columnID, ref allCharColumns); |
| | 0 | 1079 | | } |
| | | 1080 | | |
| | | 1081 | | public sbyte[] GetSbyteColumn(int columnID) |
| | 0 | 1082 | | { |
| | 0 | 1083 | | return GetColumn(columnID, ref allSbyteColumns); |
| | 0 | 1084 | | } |
| | | 1085 | | |
| | | 1086 | | public byte[] GetByteColumn(int columnID) |
| | 0 | 1087 | | { |
| | 0 | 1088 | | return GetColumn(columnID, ref allByteColumns); |
| | 0 | 1089 | | } |
| | | 1090 | | |
| | | 1091 | | public short[] GetShortColumn(int columnID) |
| | 0 | 1092 | | { |
| | 0 | 1093 | | return GetColumn(columnID, ref allShortColumns); |
| | 0 | 1094 | | } |
| | | 1095 | | |
| | | 1096 | | public ushort[] GetUshortColumn(int columnID) |
| | 0 | 1097 | | { |
| | 0 | 1098 | | return GetColumn(columnID, ref allUshortColumns); |
| | 0 | 1099 | | } |
| | | 1100 | | |
| | | 1101 | | public int[] GetIntColumn(int columnID) |
| | 0 | 1102 | | { |
| | 0 | 1103 | | return GetColumn(columnID, ref allIntColumns); |
| | 0 | 1104 | | } |
| | | 1105 | | |
| | | 1106 | | public uint[] GetUintColumn(int columnID) |
| | 0 | 1107 | | { |
| | 0 | 1108 | | return GetColumn(columnID, ref allUintColumns); |
| | 0 | 1109 | | } |
| | | 1110 | | |
| | | 1111 | | public long[] GetLongColumn(int columnID) |
| | 0 | 1112 | | { |
| | 0 | 1113 | | return GetColumn(columnID, ref allLongColumns); |
| | 0 | 1114 | | } |
| | | 1115 | | |
| | | 1116 | | public ulong[] GetUlongColumn(int columnID) |
| | 0 | 1117 | | { |
| | 0 | 1118 | | return GetColumn(columnID, ref allUlongColumns); |
| | 0 | 1119 | | } |
| | | 1120 | | |
| | | 1121 | | public float[] GetFloatColumn(int columnID) |
| | 0 | 1122 | | { |
| | 0 | 1123 | | return GetColumn(columnID, ref allFloatColumns); |
| | 0 | 1124 | | } |
| | | 1125 | | |
| | | 1126 | | public double[] GetDoubleColumn(int columnID) |
| | 0 | 1127 | | { |
| | 0 | 1128 | | return GetColumn(columnID, ref allDoubleColumns); |
| | 0 | 1129 | | } |
| | | 1130 | | |
| | | 1131 | | public Vector2[] GetVector2Column(int columnID) |
| | 0 | 1132 | | { |
| | 0 | 1133 | | return GetColumn(columnID, ref allVector2Columns); |
| | 0 | 1134 | | } |
| | | 1135 | | |
| | | 1136 | | public Vector3[] GetVector3Column(int columnID) |
| | 0 | 1137 | | { |
| | 0 | 1138 | | return GetColumn(columnID, ref allVector3Columns); |
| | 0 | 1139 | | } |
| | | 1140 | | |
| | | 1141 | | public Vector4[] GetVector4Column(int columnID) |
| | 0 | 1142 | | { |
| | 0 | 1143 | | return GetColumn(columnID, ref allVector4Columns); |
| | 0 | 1144 | | } |
| | | 1145 | | |
| | | 1146 | | public Vector2Int[] GetVector2IntColumn(int columnID) |
| | 0 | 1147 | | { |
| | 0 | 1148 | | return GetColumn(columnID, ref allVector2IntColumns); |
| | 0 | 1149 | | } |
| | | 1150 | | |
| | | 1151 | | public Vector3Int[] GetVector3IntColumn(int columnID) |
| | 0 | 1152 | | { |
| | 0 | 1153 | | return GetColumn(columnID, ref allVector3IntColumns); |
| | 0 | 1154 | | } |
| | | 1155 | | |
| | | 1156 | | public Quaternion[] GetQuaternionColumn(int columnID) |
| | 0 | 1157 | | { |
| | 0 | 1158 | | return GetColumn(columnID, ref allQuaternionColumns); |
| | 0 | 1159 | | } |
| | | 1160 | | |
| | | 1161 | | public Rect[] GetRectColumn(int columnID) |
| | 0 | 1162 | | { |
| | 0 | 1163 | | return GetColumn(columnID, ref allRectColumns); |
| | 0 | 1164 | | } |
| | | 1165 | | |
| | | 1166 | | public RectInt[] GetRectIntColumn(int columnID) |
| | 0 | 1167 | | { |
| | 0 | 1168 | | return GetColumn(columnID, ref allRectIntColumns); |
| | 0 | 1169 | | } |
| | | 1170 | | |
| | | 1171 | | public Color[] GetColorColumn(int columnID) |
| | 0 | 1172 | | { |
| | 0 | 1173 | | return GetColumn(columnID, ref allColorColumns); |
| | 0 | 1174 | | } |
| | | 1175 | | |
| | | 1176 | | public LayerMask[] GetLayerMaskColumn(int columnID) |
| | 0 | 1177 | | { |
| | 0 | 1178 | | return GetColumn(columnID, ref allLayerMaskColumns); |
| | 0 | 1179 | | } |
| | | 1180 | | |
| | | 1181 | | public Bounds[] GetBoundsColumn(int columnID) |
| | 0 | 1182 | | { |
| | 0 | 1183 | | return GetColumn(columnID, ref allBoundsColumns); |
| | 0 | 1184 | | } |
| | | 1185 | | |
| | | 1186 | | public BoundsInt[] GetBoundsIntColumn(int columnID) |
| | 0 | 1187 | | { |
| | 0 | 1188 | | return GetColumn(columnID, ref allBoundsIntColumns); |
| | 0 | 1189 | | } |
| | | 1190 | | |
| | | 1191 | | public Hash128[] GetHash128Column(int columnID) |
| | 0 | 1192 | | { |
| | 0 | 1193 | | return GetColumn(columnID, ref allHash128Columns); |
| | 0 | 1194 | | } |
| | | 1195 | | |
| | | 1196 | | public Gradient[] GetGradientColumn(int columnID) |
| | 0 | 1197 | | { |
| | 0 | 1198 | | return GetColumn(columnID, ref allGradientColumns); |
| | 0 | 1199 | | } |
| | | 1200 | | |
| | | 1201 | | public AnimationCurve[] GetAnimationCurveColumn(int columnID) |
| | 0 | 1202 | | { |
| | 0 | 1203 | | return GetColumn(columnID, ref allAnimationCurveColumns); |
| | 0 | 1204 | | } |
| | | 1205 | | |
| | | 1206 | | public UnityEngine.Object[] GetObjectColumn(int columnID) |
| | 0 | 1207 | | { |
| | 0 | 1208 | | return GetColumn(columnID, ref allObjectRefColumns); |
| | 0 | 1209 | | } |
| | | 1210 | | |
| | | 1211 | | // Internal |
| | | 1212 | | |
| | | 1213 | | internal int AddColumnInternal<T>(string columnName, ref ArrayHolder<T>[] allColumnsOfType, ITable.ColumnType ty |
| | 0 | 1214 | | { |
| | 0 | 1215 | | int columnCount = allColumnsOfType?.Length ?? 0; |
| | 0 | 1216 | | Array.Resize(ref allColumnsOfType, columnCount + 1); |
| | 0 | 1217 | | allColumnsOfType[columnCount].TArray = new T[rowCount]; |
| | | 1218 | | |
| | 0 | 1219 | | string[] columnNamesForType = allColumnNames[(int)typeIndex].TArray; |
| | 0 | 1220 | | int columnNamesCount = columnNamesForType?.Length ?? 0; |
| | 0 | 1221 | | Array.Resize(ref columnNamesForType, columnNamesCount + 1); |
| | 0 | 1222 | | columnNamesForType[columnNamesCount] = columnName; |
| | 0 | 1223 | | allColumnNames[(int)typeIndex].TArray = columnNamesForType; |
| | | 1224 | | |
| | 0 | 1225 | | int columnIndex = columnEntriesFreeListHead; |
| | 0 | 1226 | | int columnIDToDenseIndexMapLength = columnIDToDenseIndexMap?.Length ?? 0; |
| | 0 | 1227 | | if (columnIndex >= columnIDToDenseIndexMapLength) |
| | 0 | 1228 | | { |
| | 0 | 1229 | | int newSize = columnIndex * 2; |
| | 0 | 1230 | | newSize = newSize == 0 ? 1 : newSize; |
| | 0 | 1231 | | Array.Resize(ref columnIDToDenseIndexMap, newSize); |
| | 0 | 1232 | | for (int i = 0; i < columnIndex; i++) |
| | 0 | 1233 | | { |
| | 0 | 1234 | | ref ColumnEntryInternal entry = ref columnIDToDenseIndexMap[columnIndex + i]; |
| | 0 | 1235 | | entry.columnDenseIndex = columnIndex + i + 1; |
| | 0 | 1236 | | entry.ColumnType = ITable.ColumnType.Invalid; |
| | 0 | 1237 | | } |
| | 0 | 1238 | | } |
| | | 1239 | | |
| | 0 | 1240 | | ref int[] denseIndexToIDMap = ref columnDenseIndexToIDMap[(int)typeIndex].TArray; |
| | 0 | 1241 | | int denseIndexToIDMapLength = denseIndexToIDMap?.Length ?? 0; |
| | 0 | 1242 | | Array.Resize(ref denseIndexToIDMap, denseIndexToIDMapLength + 1); |
| | 0 | 1243 | | denseIndexToIDMap[denseIndexToIDMapLength] = columnIndex; |
| | | 1244 | | |
| | 0 | 1245 | | ref ColumnEntryInternal newEntryInternal = ref columnIDToDenseIndexMap[columnIndex]; |
| | 0 | 1246 | | newEntryInternal.columnDenseIndex = denseIndexToIDMapLength; |
| | 0 | 1247 | | newEntryInternal.ColumnType = typeIndex; |
| | | 1248 | | |
| | 0 | 1249 | | insertAt = insertAt < 0 ? combinedColumnCount : insertAt; |
| | 0 | 1250 | | ref int[] columnOrdersOfType = ref allColumnOrders[(int)typeIndex].TArray; |
| | 0 | 1251 | | int columnOrdersOfTypeLength = columnOrdersOfType?.Length ?? 0; |
| | 0 | 1252 | | Array.Resize(ref columnOrdersOfType, columnOrdersOfTypeLength + 1); |
| | 0 | 1253 | | columnOrdersOfType[columnOrdersOfTypeLength] = insertAt; |
| | | 1254 | | |
| | 0 | 1255 | | for (int i = 0; i < (int)ITable.ColumnType.Count; i++) |
| | 0 | 1256 | | { |
| | 0 | 1257 | | int[] columnOrdersOfTypeCurrent = allColumnOrders[i].TArray; |
| | 0 | 1258 | | int columnOrdersLength = columnOrdersOfTypeCurrent?.Length ?? 0; |
| | 0 | 1259 | | for (int j = 0; j < columnOrdersLength; j++) |
| | 0 | 1260 | | { |
| | 0 | 1261 | | int columnOrderCurrent = columnOrdersOfTypeCurrent[j]; |
| | | 1262 | | |
| | 0 | 1263 | | if (columnOrderCurrent > insertAt) |
| | 0 | 1264 | | { |
| | 0 | 1265 | | columnOrdersOfType[j] = columnOrderCurrent + 1; |
| | 0 | 1266 | | } |
| | 0 | 1267 | | } |
| | 0 | 1268 | | } |
| | | 1269 | | |
| | 0 | 1270 | | ++combinedColumnCount; |
| | 0 | 1271 | | dataVersion++; |
| | | 1272 | | |
| | 0 | 1273 | | return columnIndex; |
| | 0 | 1274 | | } |
| | | 1275 | | |
| | | 1276 | | internal void RemoveColumnInternal<T>(ref ArrayHolder<T>[] allColumnsOfType, ITable.ColumnType typeIndex, int co |
| | 0 | 1277 | | { |
| | 0 | 1278 | | int columnLocation = columnIDToDenseIndexMap[columnID].columnDenseIndex; |
| | | 1279 | | |
| | 0 | 1280 | | int lastIndex = allColumnsOfType.Length - 1; |
| | 0 | 1281 | | allColumnsOfType[columnLocation] = allColumnsOfType[lastIndex]; |
| | | 1282 | | // T[][] newColumnArray = new T[lastIndex][]; |
| | 0 | 1283 | | ArrayHolder<T>[] newColumnArray = new ArrayHolder<T>[lastIndex]; |
| | 0 | 1284 | | Array.Copy(allColumnsOfType, 0, newColumnArray, 0, lastIndex); |
| | 0 | 1285 | | allColumnsOfType = newColumnArray; |
| | | 1286 | | |
| | 0 | 1287 | | string[] columnNamesOfType = allColumnNames[(int)typeIndex].TArray; |
| | 0 | 1288 | | columnNamesOfType[columnLocation] = columnNamesOfType[lastIndex]; |
| | 0 | 1289 | | string[] newColumnNamesOfType = new string[lastIndex]; |
| | 0 | 1290 | | Array.Copy(columnNamesOfType, 0, newColumnNamesOfType, 0, lastIndex); |
| | 0 | 1291 | | allColumnNames[(int)typeIndex].TArray = newColumnNamesOfType; |
| | | 1292 | | |
| | 0 | 1293 | | int[] columnOrdersOfType = allColumnOrders[(int)typeIndex].TArray; |
| | 0 | 1294 | | int columnOrder = columnOrdersOfType[columnLocation]; |
| | 0 | 1295 | | columnOrdersOfType[columnLocation] = columnOrdersOfType[lastIndex]; |
| | 0 | 1296 | | int[] newColumnOrdersOfType = new int[lastIndex]; |
| | 0 | 1297 | | Array.Copy(columnOrdersOfType, 0, newColumnOrdersOfType, 0, lastIndex); |
| | 0 | 1298 | | allColumnOrders[(int)typeIndex].TArray = newColumnOrdersOfType; |
| | | 1299 | | |
| | 0 | 1300 | | int[] denseIndicesOfType = columnDenseIndexToIDMap[(int)typeIndex].TArray; |
| | 0 | 1301 | | int sparseIndexAt = denseIndicesOfType[columnLocation]; |
| | 0 | 1302 | | int sparseIndexToSwap = columnOrdersOfType[lastIndex]; |
| | 0 | 1303 | | ref ColumnEntryInternal sparseIndexToFree = ref columnIDToDenseIndexMap[sparseIndexAt]; |
| | 0 | 1304 | | sparseIndexToFree.ColumnType = ITable.ColumnType.Invalid; |
| | 0 | 1305 | | sparseIndexToFree.columnDenseIndex = columnEntriesFreeListHead; |
| | 0 | 1306 | | columnEntriesFreeListHead = sparseIndexAt; |
| | 0 | 1307 | | columnIDToDenseIndexMap[sparseIndexToSwap].columnDenseIndex = columnLocation; |
| | 0 | 1308 | | denseIndicesOfType[columnLocation] = sparseIndexToSwap; |
| | 0 | 1309 | | int[] newDenseIndicesOfType = new int[lastIndex]; |
| | 0 | 1310 | | Array.Copy(denseIndicesOfType, 0, newDenseIndicesOfType, 0, lastIndex); |
| | 0 | 1311 | | columnDenseIndexToIDMap[(int)typeIndex].TArray = newDenseIndicesOfType; |
| | | 1312 | | |
| | 0 | 1313 | | for (int i = 0; i < (int)ITable.ColumnType.Count; i++) |
| | 0 | 1314 | | { |
| | 0 | 1315 | | int[] columnOrdersOfTypeCurrent = allColumnOrders[i].TArray; |
| | | 1316 | | |
| | 0 | 1317 | | int columnOrdersLength = columnOrdersOfTypeCurrent.Length; |
| | 0 | 1318 | | for (int j = 0; j < columnOrdersLength; j++) |
| | 0 | 1319 | | { |
| | 0 | 1320 | | int columnOrderCurrent = columnOrdersOfTypeCurrent[j]; |
| | | 1321 | | |
| | 0 | 1322 | | if (columnOrderCurrent > columnOrder) |
| | 0 | 1323 | | { |
| | 0 | 1324 | | columnOrdersOfType[j] = columnOrderCurrent - 1; |
| | 0 | 1325 | | } |
| | 0 | 1326 | | } |
| | 0 | 1327 | | } |
| | | 1328 | | |
| | 0 | 1329 | | --combinedColumnCount; |
| | 0 | 1330 | | dataVersion++; |
| | 0 | 1331 | | } |
| | | 1332 | | |
| | | 1333 | | internal void InsertRowsOfTypeInternal<T>(ref ArrayHolder<T>[] allColumnsOfType, int insertAt, int numberOfNewRo |
| | 0 | 1334 | | { |
| | 0 | 1335 | | int columnCount = allColumnsOfType?.Length ?? 0; |
| | 0 | 1336 | | for (int i = 0; i < columnCount; i++) |
| | 0 | 1337 | | { |
| | 0 | 1338 | | ref T[] column = ref allColumnsOfType[i].TArray; |
| | 0 | 1339 | | int newRowCount = rowCount + numberOfNewRows; |
| | 0 | 1340 | | Array.Resize(ref column, newRowCount); |
| | 0 | 1341 | | for (int j = newRowCount - 1; j > insertAt + numberOfNewRows - 1; j--) |
| | 0 | 1342 | | { |
| | 0 | 1343 | | column[j] = column[j - numberOfNewRows]; |
| | 0 | 1344 | | } |
| | | 1345 | | |
| | 0 | 1346 | | for (int j = 0; j < numberOfNewRows; j++) |
| | 0 | 1347 | | { |
| | 0 | 1348 | | column[insertAt + i] = default; |
| | 0 | 1349 | | } |
| | 0 | 1350 | | } |
| | 0 | 1351 | | } |
| | | 1352 | | |
| | | 1353 | | internal void DeleteRowsOfTypeInternal<T>(ref ArrayHolder<T>[] allColumnsOfType, int removeAt, int numberOfRowsT |
| | 0 | 1354 | | { |
| | 0 | 1355 | | int columnCount = allColumnsOfType?.Length ?? 0; |
| | | 1356 | | |
| | 0 | 1357 | | for (int i = 0; i < columnCount; i++) |
| | 0 | 1358 | | { |
| | 0 | 1359 | | ref T[] column = ref allColumnsOfType[i].TArray; |
| | 0 | 1360 | | int newRowCount = rowCount - numberOfRowsToDelete; |
| | | 1361 | | |
| | 0 | 1362 | | for (int j = removeAt; j < rowCount - numberOfRowsToDelete; j++) |
| | 0 | 1363 | | { |
| | 0 | 1364 | | column[j] = column[j + numberOfRowsToDelete]; |
| | 0 | 1365 | | } |
| | | 1366 | | |
| | 0 | 1367 | | Array.Resize(ref column, newRowCount); |
| | 0 | 1368 | | } |
| | 0 | 1369 | | } |
| | | 1370 | | |
| | | 1371 | | internal ref T GetCellRef<T>(int row, int columnID, ref ArrayHolder<T>[] allColumnsOfType) |
| | 0 | 1372 | | { |
| | 0 | 1373 | | int column = columnIDToDenseIndexMap[columnID].columnDenseIndex; |
| | 0 | 1374 | | return ref allColumnsOfType[column][row]; |
| | 0 | 1375 | | } |
| | | 1376 | | |
| | | 1377 | | internal T GetCell<T>(int row, int columnID, ref ArrayHolder<T>[] allColumnsOfType) |
| | 0 | 1378 | | { |
| | 0 | 1379 | | int column = columnIDToDenseIndexMap[columnID].columnDenseIndex; |
| | 0 | 1380 | | return allColumnsOfType[column][row]; |
| | 0 | 1381 | | } |
| | | 1382 | | |
| | | 1383 | | internal ulong SetCell<T>(int row, int columnID, ref ArrayHolder<T>[] allColumnsOfType, T value) |
| | 0 | 1384 | | { |
| | 0 | 1385 | | int column = columnIDToDenseIndexMap[columnID].columnDenseIndex; |
| | 0 | 1386 | | allColumnsOfType[column][row] = value; |
| | 0 | 1387 | | dataVersion++; |
| | 0 | 1388 | | return dataVersion; |
| | 0 | 1389 | | } |
| | | 1390 | | |
| | | 1391 | | internal T[] GetColumn<T>(int columnID, ref ArrayHolder<T>[] allColumnsOfType) |
| | 0 | 1392 | | { |
| | 0 | 1393 | | int column = columnIDToDenseIndexMap[columnID].columnDenseIndex; |
| | 0 | 1394 | | return allColumnsOfType[column].TArray; |
| | 0 | 1395 | | } |
| | | 1396 | | } |
| | | 1397 | | } |